<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class CrawlerArticle extends Model
{
    use Traits\CrawlerArticleHelper;
    protected $fillable = ['title', 'content', 'category_id', 'tags'];

    protected $connection = 'crawler-mysql';

    public function article()
    {
        return $this->hasOne('App\Models\Article');
    }

    public function pictuer()
    {
        return $this->hasMany('App\Models\CrawlerPictuer');
    }
    public function is_publish()
    {
        //是否发布
        return !null === $this->article;
    }
}
